negotiator.actions
Class Offer

java.lang.Object
  extended by negotiator.actions.Action
      extended by negotiator.actions.Offer

public class Offer
extends Action

Class which symbolizes an offer of an agent for the opponent.

Author:
Tim Baarslag and Dmytro Tykhonov

Constructor Summary
Offer(Agent agent, Bid bid)
          Creates an action symbolizing an offer to the opponent.
Offer(AgentID agentID, Bid bid)
          Creates an action symbolizing an offer for the opponent.
Offer(Bid bid)
          Creates an action symbolizing an offer for the opponent.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 Bid getBid()
          Returns the bid offered by the agent which created this offer.
 int hashCode()
           
 java.lang.String toString()
          Enforces that actions implements a string-representation.
 
Methods inherited from class negotiator.actions.Action
getAgent, getBidFromAction
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Offer

public Offer(AgentID agentID,
             Bid bid)
Creates an action symbolizing an offer for the opponent.

Parameters:
agentID - id of the agent which created the offer.
bid - for the opponent.

Offer

public Offer(Bid bid)
Creates an action symbolizing an offer for the opponent.

Parameters:
bid - for the opponent.

Offer

public Offer(Agent agent,
             Bid bid)
Creates an action symbolizing an offer to the opponent.

Parameters:
agent - which created this offer.
bid - to be offered to the opponent.
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
hashcode of this object.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
Parameters:
obj - object to which this object is compared.
Returns:
true if this object is equal to the given object.

getBid

public Bid getBid()
Returns the bid offered by the agent which created this offer.

Returns:
bid to offer.

toString

public java.lang.String toString()
Description copied from class: Action
Enforces that actions implements a string-representation.

Specified by:
toString in class Action
Returns:
string representation of action: "(Offer: BID)".